package com;

import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.LinkedBlockingDeque;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

public class ReportTest {
    public static void main(String[] args) throws InterruptedException {

        Map<Long, ReportThread> REPORT_THREAD_MAP = new ConcurrentHashMap<>();
        Map<String, Object> params = new HashMap<>();
        ReportThread reportThread = new ReportThread(params);
        REPORT_THREAD_MAP.put(1L, reportThread);

        ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(2, 2, 0, TimeUnit.MINUTES, new LinkedBlockingDeque<>(10));
        threadPoolExecutor.submit(reportThread);


        Thread.sleep(3000);
        threadPoolExecutor.submit(() -> {
            ReportThread reportThread1 = REPORT_THREAD_MAP.get(1L);
            reportThread1.setExit(true);
        });
    }
}
